programming4us
           
 
 
Windows

Windows 7 : Preventing Users from Logging On at Certain Times

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/26/2010 5:03:29 PM
If you’ve set up user accounts so that other people on your network can access your computer, by default those users can view and use your shares any time of day. That’s not usually a problem, but you may want to prevent users from logging on at certain times. For example, if you work with a particular shared folder each afternoon, you might not want users accessing that folder until you’re done.

Windows 7 enables you to specify the days of the week and hours of the day that a particular user is allowed to log on to your system. When the user attempts to access your computer over the network outside of those hours, he or she sees a dialog box similar to the one shown in Figure 1.

Figure 1. If you’ve set up logon hours for a user, that person sees a dialog box similar to this when attempting to log on outside of those hours.


The next couple of sections show you how to work with this feature.

Setting a User’s Logon Hours

Unfortunately, Windows 7 doesn’t have a dialog box or other interface that you can use to set logon hours for a user. Instead, you must use a Command Prompt session where you enter a command using the following general syntax:

net user username /times:day1,times1;day2,times2,...

usernameThe name of the user account you want to work with.
day1, day2The day of the week that the user is allowed to log on. You can spell out the days, but it’s quicker to use the following codes (case doesn’t matter): Su, M, T, W, Th, F, and Sa. You can also specify a range of days, such as M-F (for Monday to Friday).
time1, time2For a given day, the time range that the user is allowed to log on. The range syntax is start-end, where start is the beginning of the logon hours, and end is the end of the logon hours. You can either use 24-hour notation or 12-hour notation, although the latter means you must also specify AM and PM.

Here are some examples:

net user karen /times:M-F,9AM-5PM
net user steve /times:M,18-24
net user emily /times:Sa,10PM-6PM; Su,12PM-6PM

Tip

If you’ve previously set a user’s logon hours, you may decide later to remove those restrictions. To give a user access at all times, use the all parameter:

net user katy /times:all

To give a user no access, use no parameters:

net user jordan /times:


Follow these steps to specify logon hours for a user:

1.
Select Start and type command.

2.
In the search results, right-click Command Prompt, and then click Run as Administrator. The User Account Control dialog box appears.

3.
Enter your UAC credentials to continue. Windows 7 opens an administrator Command Prompt session.

4.
Type your net user /times command and press Enter. The NET USER command responds with The command completed successfully.

5.
Repeat step 4 to specify all the logon hours you want to implement.

6.
Type exit and press Enter to close the Command Prompt session.

Automatically Logging Off a User When the Logon Hours Expire

By default, Windows 7 does nothing if a user is currently logged on to your computer and that person’s logon hours expire. In other words, there’s nothing to prevent a teenager from hanging out online all night instead of doing homework! To fix this, you can configure Windows 7 to automatically log off the user when the account’s logon hours are over. Here are the steps to follow:

Note

These steps require the Local Security Policy snap-in, which is available only with Windows 7 Professional, Enterprise, and Ultimate.


1.
Select Start, type secpol.msc, and press Enter. The Local Security Policy window appears.

2.
Open the Security Settings, Local Policies, Security Options branch.

3.
Double-click the Network Security: Force Logoff When Logon Hours Expire policy.

4.
Click the Enabled option, as shown in Figure 2.

Figure 2. Enable the Network Security: Force Logoff When Logon Hours Expire policy.


5.
Click OK.
Other -----------------
- Windows 7 : Removing Stored Remote Desktop Credentials
- Windows 7 : Disabling the Hidden Administrative Shares
- Windows 7 : Hiding Your Shared Folders
- Windows 7 : Setting Security Permissions on Shared Folders
- Windows 7 : Setting Sharing Permissions on Shared Folders
- Configuring Windows 7 for Secure Networking
- Windows 7 : Setting Up User Security - Determining Who Is Logged On
- Windows 7 : Setting Up User Security - Using the Guest Account to Give Folks Temporary Access
- Windows 7 : Setting Up User Security - Renaming Built-In Accounts for Better Security
- Windows 7 : Setting Up User Security - Hiding Usernames in the Logon Screen
- Windows 7 : Setting Up User Security - Closing Off Your Computer by Disabling All Other Users
- Windows 7 : Setting Up User Security - Preventing Elevation for All Standard Users
- Windows 7 : Using Parental Controls to Restrict Computer Usage (part 2) - Setting Up Parental Controls for Games
- Windows 7 : Using Parental Controls to Restrict Computer Usage (part 1) - Activating Parental Controls
- Windows 7 : Working with Users and Groups from the Command Line
- Windows 7 : Setting Account Policies (part 2)
- Windows 7 : Setting Account Policies (part 1)
- Windows 7 : Creating and Managing User Accounts (part 2) - Working with the User Accounts Dialog Box
- Windows 7 : Creating and Managing User Accounts (part 1)
- Windows Vista : Managing Local Logon Accounts
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us